<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="UTF-8">
		<title>主页</title>
		<link rel="stylesheet" href="static/layui/css/layui.css" />
		<script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>
		<style type="text/css">
			body {
				margin: 50px;
			}
		</style>
	</head>

	<body>
		
		<button id="selectBtn" class="layui-btn layui-btn-sm layui-btn-radius layui-bg-cyan">
			<i class="layui-icon">&#xe602;</i>select
		</button>
		<button id="insertBtn" class="layui-btn layui-btn-normal layui-btn-sm layui-btn-radius">
			<i class="layui-icon">&#xe654;</i>insert
		</button>
		<button id="updateBtn" class="layui-btn layui-btn-warm layui-btn-sm layui-btn-radius">
			<i class="layui-icon">&#xe642;</i>update
		</button>
		<button id="deleteBtn" class="layui-btn layui-btn-danger layui-btn-sm layui-btn-radius">
			<i class="layui-icon">&#xe640;</i>delete
		</button>

		<hr />
		<button id="vipBtn" class="layui-btn layui-btn-lg">
			vip
		</button>
		<button id="ipBtn" class="layui-btn layui-btn-lg">
			ip
		</button>
		<button id="pBtn" class="layui-btn layui-btn-lg">
			p
		</button>
		
		<hr/>
		<a class="layui-btn layui-btn-sm layui-btn-primary" href="logout">注销</a>
	</body>
	<script type="text/javascript">
		$("#selectBtn").click(function() {
			$.post("http://localhost/user/select", {}, function(result) {
				if(result.success) {
					alert(result.msg);
					return false;
				} else {
					alert(result.errorInfo);
					return false;
				}
			});
		});

		$("#insertBtn").click(function() {
			$.post("http://localhost/user/insert", {}, function(result) {
				if(result.success) {
					alert(result.msg);
					return false;
				} else {
					alert(result.errorInfo);
					return false;
				}
			});
		});

		$("#updateBtn").click(function() {
			$.post("http://localhost/user/update", {}, function(result) {
				if(result.success) {
					alert(result.msg);
					return false;
				} else {
					alert(result.errorInfo);
					return false;
				}
			});
		});

		$("#deleteBtn").click(function() {
			$.post("http://localhost/user/delete", {}, function(result) {
				if(result.success) {
					alert(result.msg);
					return false;
				} else {
					alert(result.errorInfo);
					return false;
				}
			});
		});

		$("#vipBtn").click(function() {
			$.post("http://localhost/user/vip", {}, function(result) {
				if(result.success) {
					alert(result.msg);
					return false;
				} else {
					alert('无权访问');
					return false;
				}
			});
		});

		$("#ipBtn").click(function() {
			$.post("http://localhost/user/ip", {}, function(result) {
				if(result.success) {
					alert(result.msg);
					return false;
				} else {
					alert('无权访问');
					return false;
				}
			});
		});
		$("#pBtn").click(function() {
			$.post("http://localhost/user/p", {}, function(result) {
				if(result.success) {
					alert(result.msg);
					return false;
				} else {
					alert('无权访问');
					return false;
				}
			});
		});
	</script>

</html>